//@ sourceURL=EnvironmentalMonitorView.js
Ext.ns("EnvironmentalMonitorView");
EnvironmentalMonitorView = Ext.extend(Ext.Panel, {
    constructor : function(a) {
        Ext.applyIf(this, a);
        var all=this.initUIComponents();
        EnvironmentalMonitorView.superclass.constructor.call(this, {
            id : "EnvironmentalMonitorView",
            title : "环保监测",
            region : "center",
            layout : "border",
            border : false,
            iconCls : "menu-position",
            items : [all.yearGridPanel,all.yearGridSearchPanel,all.yearGridTreePanel]
        });
    },
    initUIComponents : function() {
        var yearGridComponents=new createyeargridview({
            topbar : {
                inputFormName : 'EnvironmentalMonitorForm',
                topbarAdd:{
                    hidden:false
                },
                topbarDel:{
                    hidden:false
                }
            },
            search : {
                items : [ {
                    style : "margin:5px 5px 5px 5px;",
                    text : "检查部门"
                }, {
                    columnWidth : 0.2,
                    xtype : "textfield",
                    name : "Q_checkDepartment_S_LK",
                    maxLength : 256
                } ]
            },
            grid : {
                title : "环保监测列表",
                rowActions:true,
                listUrl : __ctxPath + "/environmental/listEnvironmentalMonitor.do",
                removeUrl : __ctxPath + "/environmental/deleteEnvironmentalMonitor.do",
                fields : [ "id", 'years', 'wasteType','checkDepartment', "number", "index","sourcesPollution","pollutionFactor","garbageQuota","garbageOutput"],
                columns : [ {
                    header : "id",
                    dataIndex : "id",
                    hidden : true
                }, {
                    header : "年份",
                    dataIndex : "years",
                    hidden : true,
                    sortable : true
                },{
                    header : "检查废物类型",
                    dataIndex : "wasteType",
                    width : 70
                },{
                    header : "检查部门",
                    dataIndex : "checkDepartment",
                    width : 80
                },{
                    header : "数量",
                    dataIndex : "number",
                    width : 70
                },{
                    header : "指标",
                    dataIndex : "index",
                    width : 70
                },{
                    header : "污染来源",
                    dataIndex : "sourcesPollution",
                    width : 70
                },{
                    header : "污染因子",
                    dataIndex : "pollutionFactor",
                    width : 70
                },{
                     header : "垃圾定额",
                     dataIndex : "garbageQuota",
                     width : 70
                },{
                    header : "垃圾产量",
                    dataIndex : "garbageOutput",
                    width : 70
               }
                    /*header : "管理",
                    dataIndex : "id",
                    sortable : false,
                    width : 80,
                    renderer : function(j, i, g, m, h) {
                        //var l = g.data.id;
                        var l =j;
                        var k = "";
                        if (l) {
                            if (isGranted("_ConMaterialDel")) {
                                k += '<button title="删除" value=" " class="btn-delete" onclick="ConMaterialsBaseInfoView.remove('
                                        + l + ')"></button>';
                            }
                                                           
                        }
                        return k;
                    }
                } ,*/
            ]
            },
            tree : {
                treeUrl : __ctxPath + "/environmental/treeLoadEnvironmentalMonitor.do"
            }
            
        });
        return yearGridComponents;
    }
});

